package com.zyf.temple.response;

import lombok.Data;

@Data
public class BaseResponse {

    private boolean isOk;
    private int code;   //200成功    400 客户端问题 ,      500 服务器问题
    private String message;
    private Object data;

    public BaseResponse() {
    }

    public static BaseResponse Success() {
        BaseResponse baseResponse = new BaseResponse();
        baseResponse.setOk(true);
        baseResponse.setCode(200);
        baseResponse.setMessage("请求相应成功");
        return baseResponse;
    }

    public static BaseResponse Success(Object o) {
        BaseResponse baseResponse = new BaseResponse();
        baseResponse.setOk(true);
        baseResponse.setCode(200);
        baseResponse.setMessage("请求相应成功");
        baseResponse.setData(o);
        return baseResponse;
    }
}
